<extend name="template/base_index" />

<block name="area_header">

	<link rel="stylesheet" href="__CSS__/buysell.css">
</block>

<block name="area_body">
	<div class="head">
		<a href="{:U('group/mygrouplist')}"><i class="fa fa-chevron-left"></i></a>
		<span>我的拼团</span>
	</div>


	<!--<div class="pro">-->
		<!--<div><a href="{:U('index/index',array('pid' => '2'))}">-->
			<!--<span class="index-category">全部</span></a></div>-->
		<!--<div><a href="{:U('index/index',array('pid' => '6'))}">-->
			<!--<span class="index-category">等待拼团</span></a></div>-->
		<!--<div><a href="{:U('index/index',array('pid' => '8'))}">-->
			<!--<span class="index-category">拼团成功</span></a></div>-->
		<!--<div><a href="{:U('index/index',array('pid' => '12'))}">-->
			<!--<span class="index-category">拼团失败</span></a></div>-->

	<!--</div>-->



	<volist name="buyinfo" id="buy">
		<div class="pro">
			<a href="{:U('Group/groupdetail',array('id' => $buy['id']))}"><img src="{$buy['img']}" width="80px" height="80px"></a>

				<ul>
					<li><span><a href="{:U('Group/groupdetail',array('id' => $buy['id']))}">{$buy['name']}</a></span></li>
					<li><p>&yen;{$buy['price']}
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<if condition="$buy['status'] == -1">
								拼团失败
						</if>
						<if condition="$buy['status'] == 1">
							拼团中
						</if>
						<if condition="$buy['status'] == 2">
							拼团成功
						</if>
						</p>
					</li>
					<li class="gray"><i class="fa fa-clock-o"></i>{$buy['group_sum']}人团</li>
				</ul>

			<a href="{:U('Mybuysell/buydetail',array('order_code' => $buy['ordercode']))}"
			   class="pro-n-act weui_btn weui_btn_mini weui_btn_default">查看订单</a>
			<a href="http://muyin.8raw.com/index.php/Home/group/groupdetail?id={$buy['attendid']}"
			   class="pro-n-act weui_btn weui_btn_mini weui_btn_default">拼团详情</a>




		</div>
	</volist>

	<script src="__JS__/jquery-weui.min.js"></script>
	<script>
		$(function(){
			$(".show-confirm").bind("click", function() {
				var url = $(this).attr('data-href');
				$.confirm("您确定要取消订单", function() {
					$.get(url,function(msg){
						console.log(msg);
						if(msg){
							$.toast("信息发送成功");
							window.location.reload();
						}else{
							$.toast("信息发送失败");
						}
					});

				}, function() {
					//取消操作
				});
			});
			/*确认收货*/
			$(".confirm-receipt").bind("click", function() {
				var url = $(this).attr('data-href');
				$.confirm("您确定您已经收到货了", function() {
					$.get(url,function(msg){
						if(msg){
							$.toast("确认成功");
							window.location.reload();
						}else{
							$.toast("不好意思 确认失败了");
						}
					});

				}, function() {
					//取消操作
				});
			});
		})
	</script>
</block>